* Load File
import delimited "/Users/josephphillips/Dropbox/Projects/Dissertation/REAL Chapter 1 Stability/ANES Cumulative IE Non-Imputed.csv", encoding(ISO-8859-1)

* destring variables
replace polariznew="." if polariznew=="NA"
destring polariznew, replace
replace agegroup="." if agegroup=="NA"
destring agegroup, replace
replace yeargroup="." if yeargroup=="NA"
destring yeargroup, replace
replace cohort="." if cohort=="NA"
destring cohort, replace

* Affective Polarization APC
* Age Effects in Figure 1, Right Panel
* Period Effects in Figure 2, Right Panel
* Cohort Effects in Figure 4, Right Panel
apc_ie polariznew, age(agegroup) period(yeargroup) family(gaussian) link(identity)
